package cn.chrismas.alibaba.nacosdiscoveryconsumer.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.net.URI;


/**
 * 测试接口消费
 * @author chenhongbin
 * @date 20190523
 */
@RestController
public class DemoController {

	@Autowired
	private RestTemplate restTemplate;

	@GetMapping("test")
	public String test(String name) {
		String result = restTemplate.getForObject("http://nacos-discovery-provider/demo?name="+name, String.class);
		return result;
	}
}
